package StudyCode.summary.BufferAndChannel;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ReadFileUsingBufferedReader {
	public static void main(String[] args) throws IOException {
		Path path = Paths.get("E:/迅雷下载/test1.txt");
		Charset charset = Charset.defaultCharset();
		try (BufferedReader reader = Files.newBufferedReader(path, charset)) {
			String line = null;
			while ((line = reader.readLine()) != null) {
				System.out.println(line);
			}
		}
	}
}
